﻿using System;
using TechTalk.SpecFlow;
using FluentAssertions;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Support;
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Remote;

namespace DocProcessingWorkFlowScenarios
{
    [Binding]
    public class BBOSMenuItemJOBSADMINSteps
    {
        [Given]
        public void Given_JOBS_ADMIN_menu_item_is_displayed()
        {
            Assert.IsTrue(BrowserUtility.Current.PageSource.Contains("Jobs Admin"), "Jobs Admin text not present");
        }

        [When]
        public void When_I_click_JOBS_ADMIN()
        {
            BrowserUtility.Current.FindElement(By.LinkText("JOBS ADMIN")).Click();
        }

        [Then]
        public void Then_the_JOBS_ADMIN_page_displayed()
        {
           BrowserUtility.Current.Url.Contains("http://dev.nexdox.com/DocProcessingWorkflow/JobsAdmin/Index");
           Assert.IsTrue(BrowserUtility.Current.PageSource.Contains("Jobs Admin"), "Jobs Admin text not present");
           
            //BrowserUtility.Current.Close();
            //BrowserUtility.Current.Dispose();
        }
    }
}
